<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>


</head>
<body>


<script type="module">
    let zhangsan = {
        name: "张三",
        age: 18,
        friends: [
            {name: "王五", age: 18},
            {name: "刘六", age: 19}
        ]
    };

    let copy = JSON.parse(JSON.stringify(zhangsan));
    console.log(copy);
    zhangsan.age = 19;
    console.log(copy);
    zhangsan.friends[1] = {};
    console.log(copy);
    console.log(zhangsan);


</script>
</body>
</html>
